<%@ page import="java.util.*, milu.*, milu.models.*" %>
<jsp:include page="/header.jsp" />
    <ul class="recipe_list large">
<% 
List<Recipe> recipes = (List<Recipe>)request.getAttribute("recipes");
int counter = 0;
for(Recipe recipe : recipes) {
    MyUser recipeUser = MyUser.getUserInfo(recipe.getUserKey());
    List<RecipeComment> comments = RecipeComment.getCommentsForRecipe(recipe.getKey());
    if(counter == 4) counter = 0;
    counter++;
%>
    <li class="<%=(counter == 4 ? "last":"")%>" style="background: url(/serve/<%=recipe.getThumbKey().getId()%>.png) no-repeat;" alt="<%=recipe.getTitle()%>">
        <a class="image" href="/recipes/<%=recipe.getKey().getId()%>">
        </a>
        <div class="owner">
            <h2><a class="title" href="/recipes/<%=recipe.getKey().getId()%>">
                <%=recipe.getTitle()%>
            </a></h2>
            <cite>
                by <a href="/users/<%=recipeUser.getKey().getId()%>"><%=recipeUser.getName()%></a>
                <em class="recipe_stats"><span class="recipe_stats_comment"><%=comments.size()%></span> </em>
            </cite>
        </div>
    </li>

<%
}
%>
    <div style="display:none">
        <p id="loading"><img alt="Spinner" src="/images/spinner.gif?1300093942" />Loading more movies...</p>
        <form style="display: none;"><input id="load_more_path" name="load_more_path" type="hidden" value="/page/" /></form>
    </div>
</ul>
<div class="page_break"></div>
<jsp:include page="/footer.jsp" />
